/*
 * VisionProcess.h
 *
 *  Created on: Apr 19, 2010
 *      Author: Soheil Damangir
 */

#ifndef VISIONPROCESS_H_
#define VISIONPROCESS_H_
#include <fstream>

#include "camera_reader.h"
#include "image.h"
#include "image_processor.h"
#include "jpeg_buffer.h"
#include "init_systems.h"
#include "log.h"

#include "Normalizer.h"
#include "Detector.h"
#include "../Util/Conf.h"

using namespace kthrobot;

namespace Group5 {

class VisionProcess: public ProcessingTask {
public:
  VisionProcess();

  void ProcessImage(Image *image);

  DetectionResults const & getBombResult();
  DetectionResults const & getBallResult();
  DetectionResults const & getStripeResult();

  void reset_bomb_results() {
    ball_result.detected = false;
    ball_result.size = 0;
  }

  virtual ~VisionProcess();

private:
  bool log_all_result;
  bool stripe_reported;
  Image*last_image;

  Detector*ball_detector;
  Detector*bomb_detector;
  Detector*stripe_detector;

  DetectionResults ball_result;
  DetectionResults bomb_result;
  DetectionResults stripe_result;
};

}

#endif /* VISIONPROCESS_H_ */
